#include <fstream>
#include <string>
#include "bigint.h"

int main()
{
   std::ifstream in("in.txt");
   std::ofstream out("out.txt");

   std::string sa, sb;

   while (in >> sa >> sb)
   {
      if (sb == "0")
      {
         out << "<error>\n\n\n";
         continue;
      }
      big_int a = sa, b = sb;
      std::pair<big_int,big_int> ans = a.divide(b);
      out << ans.first.to_string() << "\n" << ans.second.to_string() << "\n\n";
   }
}